#ifndef DSPSIMULATOR_TIMER_H
#define DSPSIMULATOR_TIMER_H

#include <chrono>
#include <iostream>

namespace common{
    class Timer{
    private:
        std::chrono::system_clock::time_point start_time;
    public:
        Timer(){start_time = std::chrono::system_clock::now();}
        Timer(const Timer&) = delete;
        Timer &operator=(const Timer &) = delete;
        ~Timer(){
            auto end_time = std::chrono::system_clock::now();
            auto start_s_time = std::chrono::time_point_cast<std::chrono::microseconds>(start_time);
            auto end_s_time = std::chrono::time_point_cast<std::chrono::microseconds>(end_time);
            std::cout << "cost time is " << (end_s_time - start_s_time).count() << " microseconds" << std::endl;
        }
    };
}

#endif //DSPSIMULATOR_TIMER_H
